/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "taxonrank")
@NamedQueries({
    @NamedQuery(name = "Taxonrank.findAll", query = "SELECT t FROM Taxonrank t"),
    @NamedQuery(name = "Taxonrank.findByIdtaxonrank", query = "SELECT t FROM Taxonrank t WHERE t.idtaxonrank = :idtaxonrank"),
    @NamedQuery(name = "Taxonrank.findByTaxonrank", query = "SELECT t FROM Taxonrank t WHERE t.taxonrank = :taxonrank")})
public class Taxonrank implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idtaxonrank")
    private Integer idtaxonrank;
    @Basic(optional = false)
    @Column(name = "taxonrank")
    private String taxonrank;
    @OneToMany(mappedBy = "taxonrank", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Taxonrank() {
    }

    public Taxonrank(Integer idtaxonrank) {
        this.idtaxonrank = idtaxonrank;
    }

    public Taxonrank(Integer idtaxonrank, String taxonrank) {
        this.idtaxonrank = idtaxonrank;
        this.taxonrank = taxonrank;
    }

    public Integer getIdtaxonrank() {
        return idtaxonrank;
    }

    public void setIdtaxonrank(Integer idtaxonrank) {
        this.idtaxonrank = idtaxonrank;
    }

    public String getTaxonrank() {
        return taxonrank;
    }

    public void setTaxonrank(String taxonrank) {
        this.taxonrank = taxonrank;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtaxonrank != null ? idtaxonrank.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Taxonrank)) {
            return false;
        }
        Taxonrank other = (Taxonrank) object;
        if ((this.idtaxonrank == null && other.idtaxonrank != null) || (this.idtaxonrank != null && !this.idtaxonrank.equals(other.idtaxonrank))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Taxonrank[idtaxonrank=" + idtaxonrank + "]";
    }

}
